The present invention relates to a microcontroller having a diagnostic function of a pulse width modulation (PWM) timer, a control device having the microcontroller built therein, and a determination method for determining whether the diagnostic function in the microcontroller is normal, and particularly to a technology effective if applied to a microcontroller having a PWM timer built therein, which needs to have higher reliability.
A microcontroller has been incorporated into each of devices such as a household electric appliance, an AV device, a cellular phone, an automobile and an industrial machine or the like. The microcontroller is of a semiconductor integrated circuit which performs processing in accordance with a program stored in a memory to thereby perform control on the respective devices. Parts including the microcontrollers incorporated into these devices need reliability according to their use. In the automobile, for example, there is a demand for the parts including the microcontrollers to have high reliability because there is a possibility that the breakdown of a control device can lead to accidents. For example, an automobile microcontroller needs to have the function of bringing a safety device into action to detect the occurrence of a breakdown when it has occurred and prevent the automobile from being brought to a dangerous condition. Therefore, the microcontroller needs to not only detect failures in, for example, a sensor, an actuator and the like target for control by performing diagnosis on those but also detect a failure in the microcontroller itself.
Related art technologies for detecting failures in electronic equipment have been disclosed in Patent Documents 1 through 3. The Patent Document 1 has disclosed a technology in which in a timer circuit, a process for a logical addition of a count value of a counter circuit in the timer circuit and an inverted value of an immediately preceding count value is performed, and a count operation is determined to be abnormal when its added value is “0 (zero)”, after which the result of its determination is notified to the outside. The Patent Document 2 has disclosed a technology in which an automobile electronic control unit equipped with a microcontroller and an output driver circuit diagnoses earthing/powering and breaking of the output driver circuit, overcurrent of a power transistor and overtemperature of the power transistor. Further, the Patent Document 3 has disclosed a technology in which a microcontroller provided with a plurality of processing systems each comprised of a CPU and a memory compares data processed by the CPUs of the respective processing systems to detect abnormalities of the processing systems.